<?php
/**
 * @package		Joomla.Site
 * @subpackage	mod_articles_latest
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
?>


<?php foreach ($list as $item) :  ?>				
<div class="block last">					
<h2><?php echo $item->title; ?></h2>
			<a href="<?php echo $item->link; ?>" class="readmore">Read More</a>
			<div class="clear"></div>
						<div class="photo">
														<?php		
															$arr2 = preg_split('/<(IMG|img) /', $item->introtext);
															$arr3 = preg_split('/src=\"/', $arr2[1]);
															$arr4 = preg_split('/\"/', $arr3[1]);
															if(preg_match('/http:/', $arr4[0]))
															{
																$result = $arr4[0];
															}
															else if(preg_match('/^\//', $arr4[0])){
																$result = $u2 . substr($arr4[0],1);
															}
															else
															{
																for($ei = 3; $ei < sizeof($u1) - 1; $ei++)
																{
															
												$u2 .= $u1[$ei] . "/";
																}
																$result = $u2 . $arr4[0];
															}
														  ?>
							<img src="<?php if ($result=="") 
																					echo JURI::base()."/templates/cossy/images/noimg.jpg";
																					else echo $result; ?>" alt="" class="" title="<?php echo $first->title; ?>"  width="127" height="100" />
						</div>
						
							
							<p>
																			<?php						
															$words = explode(" ", strip_tags($item->introtext));
															if(count($words) > 30)
															{
																for($i=0;$i<=30;$i++)
																{
																	echo $words[$i]." ";
																}
																//echo "...";
															}
															else
															{
																echo strip_tags($item->introtext);
															}
															?>
							</p>
							
						
</div>
					
<?php endforeach; ?>					
					
